<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>医生报表</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<jsp:include page="${pageContext.request.contextPath }/resource_path.jsp" flush="true"/>
	
	<style type="text/css">
		.layui-upload-img {
		    width: 92px;
		    height: 92px;
		    margin: 0 25px 10px 10px;
		}
	</style>
</head>
<body class="layui-anim layui-anim-up">
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a>
          <cite>医生报表</cite>
        </a>
      </span>
    </div>
    <div class="x-body">
      <div style="margin-bottom: 18px">
		<div class="layui-inline">
			<table>
				<tr>
					<td>
						<input class="layui-input" name="keyword01" id="keyword01" placeholder="请输入医生姓名" autocomplete="off" style="display: inline; width: 180px; margin-left: 10px">
					</td>
					<td>
						<input class="layui-input" name="keyword02" id="keyword02" placeholder="请输入工号" autocomplete="off" style="display: inline; width: 180px; margin-left: 10px">
					</td>
				</tr>
			</table>
		</div>
		<button class="layui-btn layui-btn-normal" data-type="reload"><i class="layui-icon">&#xe615;</i>检索</button>
	  </div>

	  <table class="layui-hide" id="tableList" lay-filter="tableList"></table>
	</div>
	
	
	
	<!-- 新增框 -->
	<div id="addDivID" hidden="hidden">
		<form class="layui-form" id="addFormID">
		
		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

		  <div class="layui-tab-content" style="height: 100px;">
		    <div class="layui-tab-item layui-show">
		    	<br>
				<div class="layui-form-item">
				    <div class="layui-inline">
				      <label class="layui-form-label">医生</label>
				      <div class="layui-input-inline">
				        <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input">
				      </div>
				    </div>
				    <div class="layui-inline">
				      <label class="layui-form-label">工号</label>
				      <div class="layui-input-inline">
				        <input type="text" name="email" lay-verify="email" autocomplete="off" class="layui-input">
				      </div>
				    </div>
		  		</div>
				
				<div class="layui-form-item">
				    <div class="layui-inline">
				      <label class="layui-form-label">所属医院</label>
				      <div class="layui-input-inline">
				        <input type="tel" name="phone" lay-verify="required|phone" autocomplete="off" class="layui-input">
				      </div>
				    </div>
				    <div class="layui-inline">
				      <label class="layui-form-label">院区</label>
				      <div class="layui-input-inline">
				        <input type="text" name="email" lay-verify="email" autocomplete="off" class="layui-input">
				      </div>
				    </div>
		  		</div>
		  		
		  		  <div class="layui-form-item" pane="">
				    <label class="layui-form-label">科室</label>
				    <div class="layui-input-block">
				      <input type="checkbox" name="like1[write]" lay-skin="primary" title="眼科" checked="">
				      <input type="checkbox" name="like1[read]" lay-skin="primary" title="耳科">
				      <input type="checkbox" name="like1[read]" lay-skin="primary" title="外科">
				      <input type="checkbox" name="like1[game]" lay-skin="primary" title="内科">
				      <input type="checkbox" name="like1[game]" lay-skin="primary" title="儿科">
				      <input type="checkbox" name="like1[game]" lay-skin="primary" title="神经科">
				    </div>
				  </div>
		  		
	  		</div>

			  
		 <div class="layui-form-item" style="margin-top: 500px;">
		    <div class="layui-input-block">
		      <button class="layui-btn layui-btn-blue" lay-submit lay-filter="addForm" style="margin-left:140px;">提交</button>
		      <button class="layui-btn layui-btn-primary">取消</button>
		    </div>
		  </div>
		</form>
    </div>
    

	<script type="text/javascript">
        var table;
		layui.use(['table','layer','upload','form','laydate'], function(){
			table = layui.table;
			var layer = layui.layer;
			var form = layui.form;
			var laydate = layui.laydate;
			var $ = layui.jquery, active = {
				reload:function () {
					var keyword01 = $.trim($("#keyword01").val());
	                var keyword02 = $.trim($("#keyword02").val());
					table.reload('contenttable',{
						method:'get',
						where:{
							number:keyword01
	                        ,name:keyword02
						}
						,page: {
		                    curr: 1//重新从第 1 页开始
		                }
					});
				}
			}
			$('.layui-btn').on('click', function(){
				var type = $(this).data('type');
				active[type] ? active[type].call(this) : '';
			});
			table.render({
				elem: '#tableList'
				,url:'/json/list1.json'
				,toolbar: '#toolbar'
				,title: 'machineList'
				,id :'contenttable'
				,limits:[10,20,30]
				,request: {   //如果无需自定义请求参数，可不加该参数
	                pageName: 'page' //页码的参数名称，默认：page
	                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
	            }
	            ,response: {   //如果无需自定义数据响应名称，可不加该参数
	                countName: 'total' //规定数据总数的字段名称，默认：count
	                ,dataName: 'rows' //规定数据列表的字段名称，默认：data
	            }
				,cols: [
		                [ {
		                	field:'id',
		                	title:'序号', 
		                	sort: true,
		                	width: 60,
		                	type:'numbers',
		                	align:'center'
		                }, {
		                    field: 'mid',
		                    title: 'id',
		                    hide:true 
		                } , {
		                    field: 'remark1',
		                    title: '医生',
		                    align:'center'
		                } , {
		                    field: 'number',
		                    title: '工号',
		                    align:'center',
		                }, {
		                    field: 'name',
		                    title: '所属医院',
		                    align:'center'
		                }, {
		                    field: 'cname',
		                    title: '院区',
		                    align:'center'
		                }, {
		                    field: 'unit',
		                    title: '科室',
		                    align:'center'
		                }
		                ]
		               ]
				,page: true
				,done:function(){
			    	$('th').css({
		                'background-color': '#009688', 'color': '#fff','font-weight':'bold',
		            })
			    }
			});
            
			//监听行工具事件
			table.on('tool(tableList)', function(obj){
				var data = obj.data;
				//单个禁用
				if(obj.event === 'del'){
					
				  layer.confirm('确定禁用吗？', function(index){
					var id = obj.data.mid;
					$.ajax({
						type:'post',
						url:'${pageContext.request.contextPath }/materiel/delete.do',
						data:{ "ids" : id },
						success:function(data){
							if(data > 0){
								toastr.success("禁用成功！");
								setTimeout(function(){
									location.reload();
								},1000);
							}else{
								toastr.warning("禁用失败！");
								setTimeout(function(){
									location.reload();
								},1000);
							}
						}
					});
					layer.close(index);
				  });
				  
				} else if(obj.event === 'edit'){
					
					layer.open({
					  type: 1 							//Page层类型
					  ,area: ['700px', '830px'] //宽  高
					  ,title: '编辑'
					  ,shade: 0.6 						//遮罩透明度
					  ,maxmin: true 					//允许全屏最小化
					  ,anim: 1 							//0-6的动画形式，-1不开启
					  ,content: $('#addDivID')
                      ,end: function () {
                          var formDiv = document.getElementById('addDivID');
                          formDiv.style.display = '';
                      }
                      ,success: function(){
                    	 /*  $("#mid").val(data.mid)
                    	  $("#remark1").val(data.remark1)
                    	  $("#number").val(data.number)
                    	  $("#name").val(data.name)
                    	  $("#cname").val(data.cname)
                    	  $("#unit").val(data.unit)
                    	  $("#remark2").val(data.remark2)
                    	  $("#remark3").val(data.remark3)
                    	  //if(data.remark4 != ""){
	                    	  $("#remark4").val(data.remark4)
                    	  //}else{
                    		//  $("#remark4 option:first").prop("selected", 'selected'); 
                    	  //}
                    	  $("#remark5").val(data.remark5)
                    	  $("#remark6").val(data.remark6)
                    	  $("#remark7").val(data.remark7)
                    	  $("#remark8").val(data.remark8) */
                          form.render();
                      }
					});
				}
				
			});
      
		});
		
		toastrStyle()
	</script>
</body>
</html>